package com.huluobo.a2109amvvmdemo.room;

import androidx.room.Dao;
import androidx.room.Delete;
import androidx.room.Insert;
import androidx.room.Query;
import androidx.room.Update;

import java.util.List;

/**
 * Created by LC on 2023/11/30.
 * DAO Database Access Object 数据转换为对象
 * Dao中主要是放赠送删改查方法的
 */
@Dao
public interface AccountDao {
    @Insert
    void insertAccount(AccountBean accountBean);

    @Update
    void updateAccount(AccountBean accountBean);

    @Delete
    void deleteAccount(AccountBean accountBean);

    @Query("select * from account")
    List<AccountBean> loadAccount();

    @Query("select * from account where _loginAccount == :loginName")
    AccountBean findAccountByLoginName(String loginName);
}
